<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>appendChild()</title>
</head>
<body>

<ul id="test">
    <li>JavaScript</li>
    <li>HTML</li>
</ul>

<script type="text/javascript">

    var otest = document.getElementById("test");
    //1.在代码编辑器中，script标签内，为ul添加一个li。2.设置li内容为PHP。
    var newnode = document.createElement("li");
    newnode.innerHTML = "PHP";
    otest.appendChild(newnode);

</script>

</body>
</html>